<template>
    <div>
      <MyHead headName="精彩跟帖" @tojemp="$router.back()"></MyHead>
      <Comment :mainCommentItem="item" v-for="item in commentList" :key="item.id"></Comment>
      <div v-if="commentList" class="footer">我也是有底线的~</div>
    </div>
</template>

<script>
import MyHead from '../../components/MyHeader'
import Comment from '../../components/comment/Comment'
export default {
    data(){
        return{
            commentList:[]
        }
    },
    components:{
        MyHead,
        Comment
    },
    methods:{
        getComments(){
            this.$axios({
                url:'/post_comment/'+this.$route.params.id
            }).then(res => {
                this.commentList = res.data.data; 
            })
        }
    },
    created(){
       this.getComments();
    }
}
</script>

<style lang="less" scoped>
.footer{
    text-align: center;
    margin:20px 0 36px 0;
    color: #707070;
    font-size: 3.333vw;
}
</style>